import request from "@/utils/request";

export const brandInsertService=(brandInfo)=>{
    const brand = new URLSearchParams();
    for (let key in brandInfo) {
        brand.append(key, brandInfo[key]);
    }

    return request.post('/backend/brand',brand);
}

export const brandsInfoService=(params)=>{
    return request.get('/home/brand',{params:params});
}

export const brandInfoService=(name)=>{
    // const name = new URLSearchParams();
    // brand.append("name",name);
    return request.get('/backend/brand?name='+name);
}
export const brandIdInfoService=(id)=>{
    return request.get('/backend/brand/ids?id='+id);
}
export const upBrandInfoService=(brandInfo)=>{
    const brand = new URLSearchParams();
    for (let key in brandInfo) {
        brand.append(key, brandInfo[key]);
    }
    return request.post('/backend/brand/update',brand);
}

export const deleteBrandService=(id)=>{

    return request.delete('/backend/brand?id='+id);
}
